require 'redmine'
require 'application'
require 'my_controller'

# Add Extend Blocks in MyPage
MyController.const_set(:BLOCKS, {
  'issuesassignedtome' => :label_assigned_to_me_issues,
  'issuesreportedbyme' => :label_reported_issues,
  'issueswatched' => :label_watched_issues,
  'news' => :label_news_latest,
  'calendar' => :label_calendar,
  'documents' => :label_document_plural,
  'timelog' => :label_spent_time,
  'extendedissuesassignedtome' => :label_extended_mypage_assigned_to_me_issues,
  'extendedtimelog' => :label_extended_mypage_spent_time,
}.freeze)

Redmine::Plugin.register :redmine_extended_mypage do
  name 'Redmine Extended Mypage Plugin'
  author 'Tsubo'
  description 'This plugin provide more useful Mypage'
  url 'http://code.google.com/p/tsubo-redmine-plugins/'
  author_url 'http://code.google.com/p/tsubo-redmine-plugins/'

  settings :default => {
    'assigned_to_me_max_num' => '100',
    'spent_time_show_date' => '7',
  }, :partial => 'settings/extended_mypage_settings'

  version '0.0.2'
  requires_redmine :version_or_higher => '0.8.0'
end
